package com.panda.web.mapper.py;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panda.web.domain.JobCondition;
import com.panda.web.domain.dto.JobDTO;
import com.panda.web.domain.dto.JobQueryCondition;
import com.panda.web.domain.vo.JobVO;
import com.panda.web.domain.vo.commons.CompanyJobVO;
import com.panda.web.entity.py.Job;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 职位Mapper接口
 * 
 * @author cpanda
 * @date 2025-03-03
 */
@Mapper
public interface JobMapper extends BaseMapper<Job> {


//    List<CompanyJobVO> getHot();
    List<CompanyJobVO> getHot(@Param("param") JobDTO param);
    Integer getTotalHot(@Param("param") JobDTO param);
    List<Long> selectByIdBs(@Param("param") Job param, @Param("backgroundList") List<String> backgroundList,@Param("newMajors") List<String>newMajors,@Param("diQu") List<String>diQu,@Param("graduateYear") String graduateYear,@Param("englishSix")String englishSix,@Param("englishFour")String englishFour);
    List<Long> selectByIdCs(@Param("param") Job param, @Param("backgroundList") List<String> backgroundList,@Param("newMajors") List<String>newMajors,@Param("diQu") List<String>diQu,@Param("graduateYear") String graduateYear,@Param("englishSix")String englishSix,@Param("englishFour")String englishFour);
    List<Long> selectByIdCCs(@Param("param") Job param, @Param("backgroundList") List<String> backgroundList,@Param("newMajors") List<String>newMajors,@Param("diQu") List<String>diQu,@Param("graduateYear") String graduateYear,@Param("englishSix")String englishSix,@Param("englishFour")String englishFour);

    List<Long> selectByIdEs(@Param("param") Job param, @Param("backgroundList") List<String> backgroundList,@Param("newMajors") List<String>newMajors,@Param("diQu") List<String>diQu,@Param("graduateYear") String graduateYear,@Param("newGraduateYear") String newGraduateYear);
    List<Long> selectByIdDs(@Param("param") Job param, @Param("backgroundList") List<String> backgroundList,@Param("newMajors") List<String>newMajors,@Param("diQu") List<String>diQu);

    /**
     * 优化的职位查询方法，一次性获取完整数据
     */
    List<Job> selectJobsWithCondition(@Param("condition") JobQueryCondition condition);

    List<Job> findByCom(@Param("param") JobDTO param);
    List<Job> findByComShiyong(@Param("param") JobDTO param);
    List<Long> findByComTuiSong(@Param("param") JobDTO param);
    List<Job> findByPushDom(@Param("param") JobDTO param);


    // 查询总条数
    Long getTotalCount();

    // 新的统计查询，替代 FOUND_ROWS
    Long countByCom(@Param("param") JobDTO param);

    List<Job> selectByJobIds(@Param("jobIds") List<Long> jobIds);

    @Select("select count(*) from job where company_id !='-'")
    int selectCountByApply();


    Page<Job> selectByIdTextCCs(Page<Job> page, @Param("jobCondition") JobCondition jobCondition, @Param("param")  JobDTO dto);

    Page<CompanyJobVO> selectByIdTextHot(Page<CompanyJobVO> page, JobDTO dto);

    IPage<JobVO> selectJobPage(Page<JobVO> page,@Param("param") JobDTO dto);
}
